# FROM maven:3.8.4-openjdk-17
FROM g-ziod8129-docker.pkg.coding.net/mysterious-forest/docker/cn-base-maven:3.8.4-openjdk-17

# 定义可接受的构建参数
ARG MY_MAVEN_SERVER_ID
ARG MY_MAVEN_USERNAME
ARG MY_MAVEN_PASSWORD
ARG MY_MAVEN_MIRROR_URL
ARG MY_MAVEN_REPOSITORY_URL

# 将构建参数转换为环境变量
ENV MY_MAVEN_SERVER_ID=${MY_MAVEN_SERVER_ID}
ENV MY_MAVEN_USERNAME=${MY_MAVEN_USERNAME}
ENV MY_MAVEN_PASSWORD=${MY_MAVEN_PASSWORD}
ENV MY_MAVEN_MIRROR_URL=${MY_MAVEN_MIRROR_URL}
ENV MY_MAVEN_REPOSITORY_URL=${MY_MAVEN_REPOSITORY_URL}

WORKDIR /init
COPY settings-tengxunyun.xml /usr/share/maven/ref/settings.xml
COPY base-pom.xml .
RUN mvn -s /usr/share/maven/ref/settings.xml -f ./base-pom.xml dependency:resolve